package com.manage.web.controller;

import com.manage.service.IPasswordMigrationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/admin")
public class AdminController {

    @Autowired
    private IPasswordMigrationService migrationService;

    @RequestMapping("/password/migrate.do")
    public String migrate(Model model) {
        int updated = migrationService.migrateAllToBCrypt();
        model.addAttribute("updated", updated);
        return "admin-pw-migrate";
    }
}


